package com.tang.kite.benchmark.kite

import com.tang.kite.session.factory.SqlSessionFactory
import com.tang.kite.session.factory.SqlSessionFactoryBuilder
import javax.sql.DataSource

/**
 * @author Tang
 */
class KiteTester(private val dataSource: DataSource) {

    private val sqlSessionFactory: SqlSessionFactory by lazy {
        SqlSessionFactoryBuilder().build(dataSource)
    }

    fun select() {
        val session = sqlSessionFactory.openSession()
        val mapper = session.getMapper(KiteAccountMapper::class.java)
        mapper.select()
        session.close()
    }

}